package com.ruoyi.finance.rules.mapper;

import com.ruoyi.finance.rules.entity.SzPromotionTree;
import com.ruoyi.finance.rules.entity.SzUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author wangmh
 * @since 2023-09-21
 */
@Mapper
public interface SzUserMapper extends BaseMapper<SzUser> {

    List<Map<String, String>> listSzUserSimple(@Param("userId") String userId,@Param("nickname") String nickname);

    List<Map<String, Long>> getUpperLevelUser(@Param("userId") Long userId);

    List<Map<String, Object>> getBranchLink(@Param("parentId") Long parentId);

    int getPreviousLevelUserCount(@Param("sonVipId") Long sonVipId, @Param("parentId") Long parentId);

    Long getUserFromDatabase(@Param("parent_id") Long parent_id);

    List<SzPromotionTree> getUserInviteTree(@Param("userId") Long userId);

    Map<String, Object> getInfo(@Param("userId") Long userId);

    List<Map<String, String>> vipUpgradeRecord(@Param("userId") Long userId);

    List<Map<String, String>> deductionAmountRecord(@Param("userId") Long userId);

    List<Map<String, Object>> withdrawRecordSimple(@Param("userId") Long userId);

    int updateUserPendingActivationBalance(@Param("userId") Long userId);

    int updateUserWalletDetail(@Param("userId") Long userId);

    int updateUserAwardRecord(@Param("userId") Long userId);

    List<Map<String, Long>> selectUserJunior(@Param("id") Long id);

    BigDecimal countPeerRewards(@Param("userId") Long userId);

    BigDecimal countOldPeerRewards(@Param("userId") Long userId, @Param("startUser") Long startUser);

    Long listSzUserParentIdByUserId(@Param("userId") String userId);
}
